The present invention is generally directed to, and applicable to, management of any of a wide variety of different types of computational resources in computer systems. The present invention is discussed, below, with reference to a particular class of communications-resources management problems, but that class of problems is merely a convenient context in which to describe the present invention.
A wide variety of different types of communications protocols have been developed for exchanging data between computer systems. An exemplary communications protocol is the transmission control protocol (“TCP”), a middle-level protocol that provides reliable, sequenced, in-order message exchange over the lower-level internet protocol (“IP”) and that, together with the IP, provides one of the primary communications backbones for the internet. Many additional types of computer protocols are currently used on a variety of networking platforms, including protocols for Ethernet-based local area networks and protocols for fiber-channel communications that are often used to interconnect mass-storage-device components and interconnect host computers with mass-storage devices. Although the discussion below is based on a specific TCP-like example, the present invention is not limited to application to TCP-related communications resources, but finds general application for managing communications resources within any number of different types of computer systems that support various different communications protocols above a wide variety of different types of hardware and software.
In the current discussion, the term “communications port” refers generally to a resource used to establish a communications connection between two computer systems. In general, this is a logical resource, called a protocol port, that identifies a communications endpoint for a given protocol associated with a protocol address. A communications port may also be a physical connection that interfaces a computer system to a communications medium, an internal interface between an internal data bus and a communications-medium controller, or numerous other physical, operating-system, or protocol interfaces involved in exchange of data and commands between internal processing components of a computer system and a communications medium. For the purposes of describing the present invention, the term “communications port” refers to an interface that is directly or indirectly treated as a computational resource by a computer system involved in establishing communications connections between the computer system and a remote computer system, the exact nature of the communications port in any given system depending on the hardware and software components of the system.
FIGS. 1A-I illustrate communications ports, communications connections, and a number of problems observed in currently available communications-resources management strategies. FIGS. 1A-I all employ similar illustration conventions, described below with respect to FIG. 1A.
FIG. 1A shows a simple, abstract computational environment for communications between a client computer and a server computer. As shown in FIG. 1A, both the client computer 102 and the server computer 104 employ a fixed number of communications ports, each port represented by a small square, such as port 106 employed by client computer 102, for establishing and carrying out a communications transaction, or connection, with remote computers. In the example of FIGS. 1A-I, the client computer 102 employs a fixed number of ports arranged in a column 108 associated with the client computer, and the server computer 104 employs a fixed number of ports arranged in a column 10 of ports associated with the server computer. Ports are logical entities, each uniquely identified within a computer system by a port number, that represent the interconnection resources within a computer system related to a particular type of protocol stack and networking system. A computer system may concurrently conduct as many connections with remote computers using the protocol as there are ports. In general, the ports are partitioned into various port classes. One class, indicated in FIG. 1A by a dashed rectangle 112, comprises a set of ephemeral ports that are used for relatively short-duration connections. The ports 113-117 within the class of ephemeral ports 112 constitute a pool of ephemeral ports from which ports are allocated and to which deallocated ports are returned at relatively high frequency. The remaining ports 106 and 120-127 are generally reserved for specialized applications, connections, and tasks.
The total number of ports available in a computer system may be quite large. However, for purposes of describing the present invention, the number of ports available within a computer system is generally irrelevant. Instead, what is relevant is that the number of ports is fixed, and the number of ephemeral ports needed for short-duration connections that are established and terminated at high frequency during system operation is generally a significantly smaller, fixed number than the total number of ports. The ephemeral ports, represented in FIG. 1A by ports 113-117 within the dashed rectangle 112, represent a potential bottleneck. The ephemeral ports represent a pool of computational resources that needs to be managed carefully by the computer system in order to maintain as high a throughput of short-duration connections as possible, with concomitant minimal computational overhead and delays in ephemeral-port allocation and other ephemeral-port management operations.
FIGS. 1B-F illustrate an exemplary client/server communications (protocol?) connection. In FIG. 1B, the client computer selects port 114 from the pool of ephemeral ports 112 through which to establish a connection to the server computer 104 via a dedicated server port 130. As part of the connection-establishment protocol, a message 132 is sent from the client computer via the selected port 114 to the dedicated port 130 of the server computer. Note that, in FIG. 1B and in subsequent figures, a port that has been allocated for a connection is shown shaded, to indicate that the port is not currently available for allocation.
Next, as shown in FIG. 1C, the server replies to the initial message with a return message 134 directed by the server computer to the selected client port 114. In the exemplary connection-establishment protocol illustrated in FIGS. 1B and IC, only two messages are exchanged between the client and server to establish a connection. However, in commonly used protocols, such as the TCP protocol, exchange of more than two messages may be needed to establish a connection. The two-message exemplary connection protocol illustrated in FIGS. 1B-C is used for the sake of brevity and illustration clarity.
Next, as shown in FIG. 1D, additional messages 136-140 are exchanged between the client and server computers, in both directions, in order to complete a communications transaction. For example, files may be transferred, databases accessed and data returned, a web-page-based dialog may be carried out, or many other such activities may be carried out through an exchange of data via the communications connection. Each message is associated with a sequence number to facilitate message ordering. In the example of FIGS. 1B-1F, the third through nth messages 136-140 exchanged between the client and server computers carry the data relevant to a higher-level transaction conducted through the connection. Finally, as shown in FIG. 1E, when the higher-level transaction is complete, the server may send a final, (n+1)th message 142 to the client computer to indicate that the connection is terminated. In many currently used protocols, connection termination may involve exchange of multiple messages, and may be initiated by either the client or server computers. The simple, single-message termination illustrated in FIG. 1E is convenient for illustration clarity and brevity.
Upon receiving the termination message, the client computer considers the connection to the server computer to be terminated, as shown in FIG. 1F. However, the client port 114 and server port 130 through which the connection was conducted remain unavailable for some period of time for reconnecting the client computer to the server computer. Identifiers for the client port and server port serve to, in part, identify the client/server connection. When the connection is terminated, a new, identically identified connection cannot be re-established until after a period of time has elapsed, to allow, among other things, for correct handling of any delayed or repeated messages. Were an attempt made by the client to immediately re-establish the connection to the server through the same ephemeral client port, the server would generally reject the connection request, with an exception to be discussed below.
In essence, one may consider that a timer 144 is associated with each port to indicate some fixed-length time period, or wait period, during which the port remains unavailable for reallocation. There are several ways for a port to become immediately reusable, or reallocatable, without potentially resulting in failed connection requests due to the above-described wait periods associated with ports of terminated connections. FIG. 1G illustrates a first reallocation-enabling event. As shown in FIG. 1G, the timer 144 may expire, at which time port 114 may re-enter the pool of available ephemeral ports. FIG. 1H shows a second reallocation-enabling event that allows port 114 to become available for reallocation. As shown in FIG. 1H, if a next connection request 146 with a sequence number 148 greater than the sequence number 147 of the final message of the previous connection conducted through the ephemeral port is transmitted through the ephemeral port, then the connection request is not rejected, even when sent to the same server and server port that was previously connected to the client computer through the ephemeral port. This sequence-number-based exception allows for rapid re-establishment of identically-identified connections between computer systems in a way that prevents ambiguities in sequence numbering due to delayed messages transmitted through the most recently terminated connection. A third reallocation-enabling event is for the ephemeral port to be used for sending a connection request to a different server or to a different port of the same server, so that the resulting connection does not share the identity of the most recently terminated connection.
Whether or not a particular, first sequence number is greater than a second sequence number depends on the particular communications protocol in which the sequence numbers are used. For example, in certain cases, sequence numbers are represented by unsigned integers of fixed sizes. An ordered set of sequence numbers wraps back, from the maximally valued unsigned integer, to 0. Were an 8-bit unsigned integer used for sequence numbers, then the integer 0 directly follows the integer 255, and the integer 3 follows the integer 255 by 4 sequence numbers. On the other hand, the integer 255 follows the integer 3 by 252 sequence numbers. Thus, without a further definition for “greater,” a first sequence number of any value may follow, or be greater than, a second sequence number. One way to resolve potential ambiguity is to define a maximum distance by which one sequence number may follow another. In the currently discussed example, were a maximum distance set at 10, 3 follows 255, but 255 would not follow 3. Many other techniques for resolving such ambiguities may also be used.
Because there are a fixed and limited number of ephemeral ports available for short-duration connections, the pool of ephemeral ports together represents a potentially limiting computational resource. FIG. 1I illustrates a bottleneck that may be created by allocation of all ephemeral communications ports within a computer system. As shown in FIG. 1I, it may happen that all of the ephemeral ports 113-117 are allocated and are currently being used for connections to remote servers. In this case, subsequent attempts to allocate ephemeral ports fail. In other words, the concurrent-connection bandwidth for the computer system cannot be further expanded. Additional attempts to create connections fail, resulting in communications delays and even in failed higher-level transactions that, in turn, may result in additional computational overheads, communications delays, and even large-scale system failures. Even when a connection is terminated, the ephemeral-port resource pool may remain fully expended for a significant period of time. FIG. 1J illustrates the system, shown in FIG. 1I, following termination of one of the communications connections. In this case, the port 114 to which the terminated connection was conducted continues to remain unavailable for a fixed period of time, as discussed above with reference to FIGS. 1F-G, in order to prevent connection-request rejections that would occur were the port to be immediately and inadvertently reused to reconnect to the same port of the same server of the terminated connection
In many currently available communications and networking implementations, the pool of ephemeral ports is managed through a complex, multi-tiered list structure in which available ports are maintained on a free list, and allocated ports are maintained in various allocated-port lists representing currently used ports. Such structures are computationally expensive to manage, entailing both processing overheads and memory-space overheads that tend to quickly increase as the ephemeral-port resources approaches maximum resource allocation, potentially exacerbating computational bottlenecks resulting from the high computational overhead associated with high message traffic through a large number of concurrent communications connections. In other currently available communications and networking implementations, ports are managed through bitmaps, which are associated with similar computational overheads. Communications-protocol and network designers, computer vendors, operating-system designers and vendors, computer-system manufacturers, and computer users have all recognized the need for continued advancement and improvement in communications throughput and communications-connection bandwidth that can be achieved on any particular hardware and software platform. Moreover, the general resource management problems to which the above-described communication-port-management problems belong include many other types of resources in computer systems that may be immediately resused, following deallocation from a previous use, only when resource-reallocation-enabling information is associated with the resources to facilitate immediate reuse, and general methods for increasing efficiencies in managing such resources are continually sought by researchers, developers, manufacturers, and users of computer systems.